#pragma once
#include <string>
#include <set>
#include <functional>
#include "Singleton.h"
#include "MsgRouter.h"


class FlowService
{
public:
    bool Init();

public:
    FlowService() = default;
    virtual ~FlowService() = default;

public:
    static FlowService* Instance()
	{
		return CSingleton<FlowService>::Instance();
	}

public:
    void OnBet(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t preserve);
    void OnWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t winlose, std::int64_t bet, std::int64_t preserve);
    void OnBetAndWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t winlose);
    void OnCancleBet(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t preserve, std::uint64_t associatedorder);
    void OnCancleBetAndWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t winlose, std::uint64_t associatedorder);
    void OnReward(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint32_t activityid, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t amount);
            
protected:
    void RecordBet(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t preserve);
    void RecordWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t winlose, std::int64_t bet, std::int64_t preserve);
    void RecordBetAndWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t winlose);
    void RecordCancleBet(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t preserve, std::uint64_t associatedorder);
    void RecordCancleBetAndWin(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint64_t cycle, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t bet, std::int64_t winlose, std::uint64_t associatedorder);
    void RecordReward(std::int32_t result, std::uint32_t uid, const std::string& provider, std::uint32_t agencyid, std::uint32_t gameid, 
            std::uint32_t activityid, std::uint64_t orderid, std::uint64_t optime, std::int64_t balance, std::int64_t amount);
};







